import com.test.demo.userTest;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.ContextResource;

public class Start {
    public static void main(String[] args) {
        //两种启动spring方式1，饿汉模式
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        //2，懒汉模式
        //BeanFactory context = new XmlBeanFactory(new ClassPathResource("spring-config.xml") {
        //});
        //userTest test = (userTest) context.getBean("userTest");
        //userTest test = context.getBean(userTest.class);
        //三种获取bean方式
        userTest test = context.getBean("userTest",userTest.class);
        test.TestSuccess();
    }
}
